import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../components/HelloWorld.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/index',
    children: [
      {
        path: '/index',
        name: "index",
        component: () => import("../views/index")
      },
      {
        path: '/course',
        name: "course",
        component: () => import("../views/course")
      },
      {
        path: '/record',
        name: "record",
        component: () => import("../views/record")
      },
      {
        path: '/practice',
        name: "practice",
        component: () => import("../views/practice")
      },
      {
        path: '/mine',
        name: "mine",
        component: () => import("../views/mine")
      },
    ]
  },
  {
    path: '/login',
    name: "login",
    component: () => import("../views/login")
  },
  {
    path: '/courceDetail/:id?',
    name: "courceDetail",
    component: () => import("../views/particulars/courceDetail")
  },
  {
    path: '/coursedet/:id?',
    name: "coursedet",
    component: () => import("../views/particulars/coursedet")
  },
  {
    path: '/teacherDetail/:id?',
    name: "teacherDetail",
    component: () => import("../views/particulars/teacherDetail")
  },
  {
    path: '/search',
    name: "search",
    component: () => import("../views/particulars/search")
  },
  {
    path: '/info',
    name: "info",
    component: () => import("../views/particulars/info")
  },
  {
    path: '/options',
    name: "options",
    component: () => import("../views/particulars/options")
  },
  {
    path: '/setnewpass',
    name: "setnewpass",
    component: () => import("../views/particulars/setnewpass")
  },
]

const router = new VueRouter({
  routes
})

export default router
